<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ORTHOSYSTEM - Acesso restrito</title>
<link href="css/estilo_login.css" rel="stylesheet" type="text/css" />
</head>


<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>

<script src="./js/jQuery.js" type="text/javascript"></script>
<script src="./js/calendar.js" type="text/javascript"></script>
<script src="./js/jquery.alphanumeric.pack.js" type="text/javascript"></script>
<script src="./js/jquery.tablesorter.js" type="text/javascript"></script>
<script src="./js/linhaTabela.js" type="text/javascript"></script>

<script>

	
	
	function alterar() {
		var form = document.forms[0];
		form.metodo.value = 'editar';
		form.submit();
	}
	
	function isVazia(param){
		if(param.value == '' || param.length == 0){
			return true;
		}
		return false;
	}
	
	function validarUsuario(){
		erros = 0;
		if(isVazia(document.getElementById('login').value) && erros == 0){
			alert('O campo login é obrigatório.');
			erros = 1;
		}
		if(isVazia(document.getElementById('senha').value) && erros == 0){
			alert('Informe a senha.');
			erros = 1;
		}
		if(erros == 0){
			document.getElementById('metodo').value = 'cadastrar';
	  	  	form.submit();
		}
		
	}


	
	
</script>


<body>


<html:form action="/login" onsubmit="validarUsuario()">
	<html:hidden styleId="metodo" property="metodo" />
<div class="container_login">
	<div class="titulo">   <h1>Tela de login - Acesso restrito</h1> </div>
    
    <div class="corpo_login">
    	<label for="login">Login:</label>
        <html:text property="login" styleId="login" size="30" styleClass="campo" />
        
        <hr />
        
        <label for="senha">Senha:</label>
        <html:password property="senha" styleId="senha" size="29" styleClass="campo" />
        
        <hr />
        
        <p> <input class="botao entrar" name="entrar" type="submit" value="Entrar" />
        	<input class="botao" name="limpar" type="reset" value="Limpar" />
        
        </p>
        
    </div>
    
    <div class="rodape_login"></div>
</div>

<script type="text/javascript" language="JavaScript">
	document.getElementById('login').focus();
</script>
</html:form>
</body>
</html>



